package com.example.service.impl;

import com.example.dao.AdminDao;
import com.example.dao.impl.AdminDaoImpl;
import com.example.model.Admin;
import com.example.service.AdminService;

public class AdminServiceImpl implements AdminService {

    @Override
    public Admin login(String username, String password) {
        AdminDao adminDao = new AdminDaoImpl();
        Admin admin = adminDao.getAdminByUsername(username);
        if(admin !=null && admin.getApassword().equals(password)){
            admin.setApassword("");
            return admin;
        }
        return null;
    }
}
